﻿#pragma once
// Copyright (c) lanyeo 2020-2021
// Licenced under MIT license. See https://opensource.org/licenses/MIT for details.
// code style
// 1. use forward declaration (尽可能使用前置声明)
// 2. include file sequence [other project>c>c++>third>self project]
// 

#include <cstddef>

namespace fist
{
    constexpr size_t string_hash_code(const char* str)
    {
        const size_t M = 0x7FFFFFFFFFFFFFFF;
        size_t hash = 0;
        const char* name = str;
        while (*name) {

            const size_t seed = 131313;
            hash = hash * seed + (*name++);
        }
        return(hash % M);
    }
}
